<div class="form-error" *ngIf="control.dirty || control.touched">
    <mat-error *ngIf="control.hasError('required') && !config.hideErrMsg">
        {{config.placeholder}} {{" is required." | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('minlength')">
        {{"The length of " | translate}} {{config.placeholder}} {{" should be at least " | translate}} {{control.errors.minlength.requiredLength}}
    </mat-error>
    <mat-error *ngIf="control.hasError('maxlength')">
        {{"The length of " | translate}} {{config.placeholder}} {{" should be no more than " | translate}} {{control.errors.maxlength.requiredLength}}
    </mat-error>
    <mat-error *ngIf="control.hasError('min')">
        {{"Minimum value is " | translate}} {{control.errors.min.min}}.
    </mat-error>
    <mat-error *ngIf="control.hasError('atLeastOne')">
        {{control.errors.fields[0]}} {{" and " | translate}} {{control.errors.fields[1]}} {{". At least one is required." | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('greaterThan')">
        {{"Value must be greater than " | translate}} {{control.errors.fields[0]}}.
    </mat-error>
    <mat-error *ngIf="control.hasError('forbidden')">
        {{"The name " | translate}} <i>{{control.errors.value}}</i> {{"is already in use." | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('range')">
        {{"The value is out of range. Enter a value between " | translate}} {{control.errors.rangeValue.min}} {{" and " | translate }} {{control.errors.rangeValue.max}}.
    </mat-error>
    <mat-error *ngIf="control.hasError('regex') && !config.hideErrMsg">
        {{"Invalid format or character." | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('ip')">
        {{"Select " | translate}} {{control.errors.info[1]}} {{" to include all " | translate}} {{control.errors.info[0] | translate}} {{" addresses. When this has been chosen, additional addresses cannot be selected." | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('ip2')">
        {{"Invalid IP address" | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('matchOther')">
        {{"The passwords do not match." | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('manualValidateError')">
        {{control.errors.manualValidateErrorMsg | translate}}
    </mat-error>
    <mat-error *ngIf="control.hasError('invalidOptionSelected')">
        {{'Invalid option selected'| translate}}
    </mat-error>
</div>